package com.white.note;

import android.view.View;
import android.widget.TextView;

import com.white.note.base.BaseActivity;
import com.white.note.entity.NoteInfo;


public class NoteDetailActivity extends BaseActivity {
    private TextView tv_note_title;
    private TextView tv_note_content;

    private NoteInfo noteInfo;

    @Override
    protected int getLayoutResid() {
        return R.layout.activity_note_detail;
    }

    @Override
    protected void initViews() {
        tv_note_title = findViewById(R.id.tv_note_title);
        tv_note_content = findViewById(R.id.tv_note_content);
    }

    @Override
    protected void setListener() {
        findViewById(R.id.toolbar).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    protected void initData() {
        // 跳转传值
        noteInfo = (NoteInfo) getIntent().getSerializableExtra("noteInfo");
        if (noteInfo != null) {
            tv_note_title.setText(noteInfo.getNote_title());
            tv_note_content.setText(noteInfo.getNote_content());

        }

    }
}